<?php
class YDataGridFlagsCell extends YDataGridCell{
	var $flag_name = null;
	var $flags = null;
	public function __construct($flag_name){
		$this->flag_name = $flag_name;
	}
	
	public function render() {
		if($this->flags == null){
			$this->flags = EnumsModel::getEnums($this->flag_name);
		}
		if(empty($this->cell_data)){
			return '';
		}
		$html = '';
		foreach ($this->cell_data as $flag){
			if($html != ''){
				$html .= ',';
			}
			$html .= $this->flags[$flag];
		}
		return $html;
	}
}
?>